package com.kc.business.service.impl;

import com.kc.business.domain.KcBusinessGoodsView;
import com.kc.business.mapper.KcBusinessGoodsViewMapper;
import com.kc.business.service.KcBusinessGoodsViewService;
import com.kc.common.utils.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName KcBusinessGoodsViewServiceImpl
 * @Description TODO
 * @Author wangdongliang
 * @Date 2021/5/10 14:23
 */
@Service
public class KcBusinessGoodsViewServiceImpl implements KcBusinessGoodsViewService {
    @Resource
    private KcBusinessGoodsViewMapper kcBusinessGoodsViewMapper;
    @Override
    public List<KcBusinessGoodsView> getList(KcBusinessGoodsView kcBusinessGoodsView) {
        List<KcBusinessGoodsView> kcBusinessGoodsViews = kcBusinessGoodsViewMapper.getList(kcBusinessGoodsView);
        for (KcBusinessGoodsView businessGoodsView : kcBusinessGoodsViews){
            businessGoodsView.setThumbList(StringUtils.split(businessGoodsView.getThumb(),","));
        }
        return kcBusinessGoodsViews;
    }
}
